public class CodeBlock {
    private String name;
    private String gender;
    private int age;
    private double score;
    private static String classRoom;

    //实例代码块
    {
        this.name = "zhangsan";
        this.age = 12;
        this.gender = "male";
        System.out.println("实例代码块....");
    }

    //静态代码块
    static{
        classRoom = "一班";
        System.out.println("静态代码块....");
    }

    public CodeBlock(String name, String gender, int age, double score) {
        this.name = name;
        this.gender = gender;
        this.age = age;
        this.score = score;
        System.out.println("构造方法....");
    }

    public static void main(String[] args) {
        CodeBlock student1 = new CodeBlock("zhangsan", "male", 12, 1.0);
        System.out.println("===============");
        CodeBlock student2 = new CodeBlock("zhangsan", "female", 12, 1.0);
    }
}
